<html>
    <head>
        <meta charset="utf-8">
        <title>放大镜控件</title>
        <!-- leaflet的css样式 -->
        <link rel="stylesheet" href="../lib/leaflet.css" />
        <!-- leaflet的js库 -->
        <script type="text/javascript" src="../lib/leaflet.js"></script>

        <!-- 1.添加MiniMap插件的js和css引用 -->
        <script type="text/javascript" src="../lib/plugins/control/Control.MiniMap.min.js"></script>
        <link rel="stylesheet" type="text/css" href="../lib/plugins/control/Control.MiniMap.min.css">


        <!-- 地图容器样式 -->
        <style>
            #mapDiv{
                width: 100%;
                height: 100%;
            }
        </style>
    </head>
    <body onload="init()">
        <!--地图的容器-->
        <div id="mapDiv"></div>
    </body>
</html>

<script type="text/javascript">
    var map = null; 

    function init(){

        map = L.map("mapDiv")
               .setView([0,0], 2);

        // 2. 创建OSM的TileLayer对象
        var tile_layer = L.tileLayer(
                            'http://{s}.tile.osm.org/{z}/{x}/{y}.png',{
                                minZoom: 0, 
                                maxZoom: 13
                            }).addTo(map);

        // 3.创建鹰眼控件
        var miniMap = new L.Control.MiniMap(tile_layer).addTo(map);
    }
</script>
    


